import wtforms

from validators import BaseForm, BasePageForm


class DictForm(BaseForm):
    """
    字典表单校验类
    """
    id = wtforms.IntegerField()
    name = wtforms.StringField("字典名称", [wtforms.validators.DataRequired(message="字典名称不能为空")])
    code = wtforms.StringField("唯一编码", [wtforms.validators.DataRequired(message="唯一编码不能为空")])
    dataType = wtforms.StringField("数据类型(1:字符串；2：整型)")
    groupCode = wtforms.StringField("分组编码", [wtforms.validators.DataRequired(message="分组编码不能为空")])
    sort = wtforms.StringField("排序")
    enabled = wtforms.StringField("是否启用")
    remark = wtforms.StringField("备注")
    createUser = wtforms.StringField("创建用户")
    updateUser = wtforms.StringField("更新用户")


class DictPageForm(BasePageForm):
    """
    字典分页校验类
    """
    pass
